package com.corn.core.spring.ioc;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


public class SpringIocContextListener implements ServletContextListener {
	private static final Log log=LogFactory.getLog(SpringIocContextListener.class);
	  private static ServletContext servletcontext;

	  public void contextDestroyed(ServletContextEvent arg0)
	  {
		  servletcontext=null;
		  log.info("SpringIocContextListener Destroy success!");
	  }

	  public void contextInitialized(ServletContextEvent arg0)
	  {
	    servletcontext = arg0.getServletContext();
	    log.info("SpringIocContextListener Initial success!");
	  }
	  
	  public static ServletContext getServletcontext(){
		  return servletcontext;
	  }
	}

